1. Field of the Invention
The present invention relates to an image processing device such as an image scanner, facsimile, etc. More specifically, it relates to an image processing device that optically decodes an image which has been recorded on a medium and then converts it into an electrical signal to enable the display and transmission of digitalized information.
2. Description of the Related Art
As far as image processing devices of the prior art are concerned, routines for binarizing recorded multivalent image data by comparing it with threshold levels is being widely practiced, and various techniques are known for executing such binarizing routines.
FIG. 13 is a diagram which shows the constitution of an image processing device 5 of the prior art. The image decoding unit 14 includes a sensor unit 10. An analog signal 12 produced by said sensor unit 10 in accordance with the original decoding action of the image decoding unit 14 is converted into a digital signal 16 in an analog-digital conversion unit (A/D conversion unit) 18. The digital signal 16 which has been outputted by said A/D conversion unit 18 (one decoded line equivalent) is temporarily retained in a line data retention unit 20.
The digital signal 16 which has been produced by the A/D conversion unit 18 is further transferred to a density histogram generation unit 22 in the image processing unit 28. The density histogram generation unit 22 generates a histogram of the densities of the respective image pixels decoded.
FIGS. 14(a) and 14(b) are diagrams explaining the action of the density histogram generation unit 22. Raw image data which have been decoded by the sensor unit 10 are shown in FIG. 14(a). The image data shown in FIG. 14(b), which have been decoded, are transferred to the density histogram generation unit 22, from which a density histogram characterized by the distribution shown in FIG. 14(b) is generated.
As far as the device of the prior art is concerned, a threshold level for binarizing an image is generated by using this density histogram. The density histogram information is transferred to a threshold value generation unit 24, from which a threshold value 26 is generated, as shown in FIG. 13. The following calculation is involved in one example: Threshold value=0.5×(white peak value−black peak value)+black peak value. It may be assumed that “black peak value” signifies the peak density value of character segments, whereas the “white peak density” signifies the peak density value of the white background of the original. As far as the aforementioned example of the prior art is concerned, an intermediate level of the high-density peak level and the low-density peak level (i.e., ½) is designated as a “standard binarization” threshold value 26. This binarization threshold value 26 is input to a binarization unit 27 to produce binarized image data 29.
FIG. 15 is a diagram that shows another prior art example of an image processing device 5 for generating a threshold value 26. A digital signal 16, which has been outputted from an A/D conversion unit 18, is inputted into a shading calibration unit 30. Subsequently, a threshold level is generated according to procedures similar to those for the device of FIG. 13.
In the example of FIG. 15, however, the binarization threshold value 26 is designated while the low-density/high-density peak frequency is being taken into account. FIGS. 16(a) and 16(b) are diagrams explaining the action of the density histogram generation unit 22 of FIG. 15. the following values are specifically calculated: Minimal-to-maximal density ratio=maximal density peak frequency/(maximal density peak frequency+minimal density peak frequency); threshold value=minimal-to-maximal density ratio×(maximal density peak value−minimal density peak value)+minimal density peak value.
The example shown in FIGS. 13, 14(a) and 14(b) suffers from a disadvantage in that when the frequency rations of black and white segments radically differ (e.g., two-dimensional code), the two-dimensional code information may become excessively dense or thin even if the threshold value 26 is designated at the ½ level of the respective peak values, as a result of which it becomes impossible to binarize and reproduce the white and black dimensions of the original in high fidelity.
The example shown in FIGS. 15, 16(a) and 16(b), on the other hand, is capable of alleviating the problem of the example shown in FIGS. 13, 14(a) and 14(b) to some extent, but depending on the types of originals, it may become impossible to reproduce and express the frequency ratios of the black and white segments of the original in high fidelity, as a result of which it becomes impossible to execute a binarizing routine whereby the information specific to the original is reproduced in high fidelity.